using System.Windows.Forms;
using HgAdapter;
using HogoLogic.HgFileSystem;

namespace FileSystemView
{
	public partial class HogoFileSystemView : UserControl
	{
		public HogoFileSystemView()
		{
			InitializeComponent();
		}
		
		public void Open(string projectPath)
		{
			ProjectCommitInfo.Instance.Init(projectPath);
			directoryView.Open(new HgDirectoryInfo(projectPath));
			hogoFileView.Open(new HgDirectoryInfo(projectPath));
		}

		private void directoryView_OnSelectedDirectoryChanged(object sender, System.EventArgs e)
		{
			hogoFileView.Open(directoryView.SelectedDirectory);
		}
	}
}
